Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repair environment on load #86

Merged
merged 12 commits into from
Oct 3, 2024
Merged

Repair environment on load #86

merged 12 commits into from
Oct 3, 2024

Conversation

richfitz
Copy link
Member

@richfitz richfitz commented Oct 1, 2024

This is something we fought against a bit in dust1/mcstate1, because when using callr we won't find code that we've loaded using pkgload::load_all. This PR adds a slightly different bit of R code into the template for throwaway packages (created by dust_compile) compared with the more permanent ones created by dust_compile. This means that if a user has done dust_compile() on a model and fed that into the callr runner for monty we will load the package namespace and everything should proceed fairly happily.

This is not a big problem for code where we have created a package, installed it and run monty from there. We don't really solve this for the case where the user is developing a package and trying to use the callr runner; there we'll need them to install that package for callr to work

Closes #92 - contains the same commit 6206dc3 and then we also have the fix for our new template here too

Copy link
Contributor

@weshinsley weshinsley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talked through - all good - one more ANSI-related change below for a local test failure for me (wonder why it doesn't fail on CI) - and removing the unnecessary (.+) from my earlier hack

@richfitz richfitz merged commit bf2c6e8 into main Oct 3, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants